import bot from "../model/bot/amesu";
import func from "../model/func";
import { group } from "../shared/interface";
import { MsgAction, Tpl_battleEnd } from "../shared/master/MsgAction";
import { style_default } from "../style/default";
/**
 * 
战斗结果模板
┏┄══🎁战斗结果═━┄
🎁主场在第7回合获得胜利
🧙玩家A│▌⏳经验+1081.7万🍖宠物经验+1703.5万🌈称号经验+5🟩正义值+3🧬进化点+3
🧙玩家B│▌⏳经验+1081.7万🍖宠物经验+1703.5万🌈称号经验+5🟩正义值+3🧬进化点+3
🧙玩家C│▌⏳经验+1081.7万🍖宠物经验+1703.5万🌈称号经验+5🟩正义值+3🧬进化点+3
┗┄══🎁战斗结果═━┄
 */
export default function (data: MsgAction) {
    let d = data.data as Tpl_battleEnd;
    let s = new style_default();
    s.addLine(`┏┄══🎁战斗结束═━┄`)
    s.addLine(`🎁${d.winGroup == group.主场 ? '蓝方' : '红方'}在第${d.round}回合获得胜利`);
    for (let i = 0; i < d.gifts.length; i++) {
        const element = d.gifts[i];
        let line = `🧙${element.user_name}`;
        let info = element.info;
        if (info.exp) {
            line += `│▌⏳+${func.BN(info.exp)}`
        }
        if (info.gold) {
            line += `│▌💰️+${func.BN(info.gold)}`
        }
        s.addLine(line)
    }
    bot.sendText(data.tolocation, s.end());
}